#ifndef TABSETTINGS_H
#define TABSETTINGS_H

#include <QString>
#include <QTextBlock>
#include <QTextCursor>

class TabSettings
{
public:
    TabSettings();
    int indentationColumn(const QString &text) const;
    int columnAt(const QString &text, int position) const;
    int firstNonSpace(const QString &text) const;
    void reindentLine(QTextBlock block, int delta) const;
    QString indentationString(int startColumn, int targetColumn, const QTextBlock &currentBlock = QTextBlock()) const;
    QString indentationString(const QString &text) const;
    void indentLine(QTextBlock block, int newIndent, int padding=0) const;
    int lineIndentPosition(const QString &text) const;
    int indentedColumn(int column, bool doIndent = true) const;
    static int spacesLeftFromPosition(const QString &text, int position);
    inline bool onlySpace(const QString &text) const { return firstNonSpace(text) == text.length(); }
public:
    int m_tabSize;
    int m_indentSize;
};

#endif // TABSETTINGS_H
